// MainWindow.cpp
#include "MainWindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
    setFixedSize(400, 300);

    gameStatusLabel = new QLabel("Welcome to Wordle!", this);
    gameStatusLabel->setGeometry(10, 10, 200, 30);

    guessLineEdit = new QLineEdit(this);
    guessLineEdit->setGeometry(10, 50, 200, 30);

    guessButton = new QPushButton("Guess", this);
    guessButton->setGeometry(220, 50, 100, 30);
    connect(guessButton, &QPushButton::clicked, this, &MainWindow::guessButtonClicked);
}

void MainWindow::guessButtonClicked() {
    QString guess = guessLineEdit->text();
    wordleGame.makeGuess(guess);
    gameStatusLabel->setText(wordleGame.getGameStatus());

    // Clear the guess line edit for the next guess
    guessLineEdit->clear();
}
